package org.paradise.dms.services.impl;

import java.util.List;

import org.paradise.dms.dao.impl.AuthenticateDAOImpl;
import org.paradise.dms.pojo.SystemUser;
import org.paradise.dms.pojo.SystemUserGroup;
import org.paradise.dms.pojo.SystemUserGroupRole;
import org.paradise.dms.services.AuthenticateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AuthenticateServiceImpl implements AuthenticateService {

	@Autowired
	public AuthenticateDAOImpl authDAO;

	public void setAuthDAO(AuthenticateDAOImpl authDAO) {
		this.authDAO = authDAO;
	}

	public AuthenticateDAOImpl getAuthDAO() {
		return authDAO;
	}

	public List<SystemUser> getSysUserByNamePwd(String name, String pwd) {
		return authDAO.findSysUserByNamePwd(name, pwd);
	}

	public List<SystemUserGroupRole> getSystemUserPermissionValue(String sysusergroupid) {
		return authDAO.findSystemUserPermissionValue(sysusergroupid);
	}

	public boolean logout() {
		return false;
	}

	public List<SystemUserGroup> isSystemUserGroupUsable(String sysusergroupid) {
		return authDAO.isSystemUserGroupUsable(sysusergroupid);
	}

}
